package com.zyf.threadsOffer;

public class MyTest {
	private ManyThreads manyThreads = new ManyThreads();

	public static void main(String[] args) {
		MyTest myTest = new MyTest();
		myTest.test();
	}

	public void test() {
		for (int i = 0; i < 2; i++) {
			new Thread(new Runnable() {

				@Override
				public void run() {
					for (int i = 0; i < 20; i++) {
						manyThreads.inc();
					}
				}

			}).start();
			new Thread(new Runnable() {

				@Override
				public void run() {
					for (int i = 0; i < 20; i++) {
						manyThreads.dec();
					}
				}

			}).start();
		}
	}
}